<script>
// 顶部tab+页面切换
import { defineComponent } from 'vue'
export default defineComponent({
	name: 'WeworkQr'
})
</script>
<script setup>
import { ref } from 'vue'
import { toRaw } from '@vue/reactivity'
import CustomerSelect from './select/customer.vue'
import CustomerTable from './table/customer.vue'
import GroupSelect from './select/group.vue'
import GroupTable from './table/group.vue'
import Detail from '@/components/app/customerDetail/index.vue'
const dialogVisible = ref(true)
const customerTable = ref(null)
const module = ref('Customer')
const editQr = ref(null)
const getCustomerData = (val) => {
	console.log(val,'sdsdsd')
	customerTable.value.getData(val)
}
const detail = ref(null)
// <<<<<<< HEAD
// const showCustomerDetail = (val)=>{
// 	dialogVisible.value = true
// 	setTimeout(()=>{
// =======
const showCustomerDetail = (val) => {
	setTimeout(() => {
		detail.value.show(val)
	}, 5)
}
</script>
<template>
	<div>
		<!-- <<<<<<< HEAD
		<div v-if="!dialogVisible">
		<div class="app-tab-box app-tab-margin-top">
			<div @click="module='Customer'" :class="module=='Customer'?'app-tab-box-item-active':'app-tab-box-item'">
				客户属性筛选
			</div>
			<div @click="module='Group'" :class="module=='Group'?'app-tab-box-item-active':'app-tab-box-item'">
				所在群聊筛选
======= -->
		<div v-if="dialogVisible">
			<div class="app-tab-box app-tab-margin-top">
				<div
					@click="module = 'Customer'"
					:class="module == 'Customer' ? 'app-tab-box-item-active' : 'app-tab-box-item'"
				>
					客户属性筛选
				</div>
				<!-- <div @click="module = 'Group'" :class="module == 'Group' ? 'app-tab-box-item-active' : 'app-tab-box-item'">
					所在群聊筛选
				</div> -->
			</div>
		</div>
		<CustomerSelect v-if="module == 'Customer' && dialogVisible" @getData="getCustomerData($event,val)" />
		<CustomerTable v-if="module == 'Customer' && dialogVisible" ref="customerTable" @showDetail="showCustomerDetail($event)" />
		<GroupSelect v-if="module == 'Group'" />
		<GroupTable v-if="module == 'Group'" />
		<!-- </div> -->
		<Detail v-else ref="detail" @diaUpdate="dialogVisible = true" />
	</div>
</template>
<style lang="scss">
@import url('../../../style/app-component.scss');
@import '../../../style/mixin.scss';
</style>
